A solution known from U.S. Pat. No. 5,297,143 as well as from “LonTalk Protocol Specification”, Version 3.0, Echelon Corporation, 1995, presents a method of controlling the access of devices to the communication media in distributed networks of CSMA (Carrier Sense Multiple Access) type during communication of a group of devices, each of which is a node of a distributed network and generates data sent in packet cycles with the use of the communication medium in a system with or without acknowledgment of a message reception while before the attempt of a packet transmission a state of the communication medium is sensed each time using the state detectors of particular nodes connected to this medium.
When the communication medium is sensed idle, in each packet cycle the prespecified fixed time interval called the minimum interpacket space is timed out by the use of a clock in every node, while during the minimum interpacket space a number of available time slots of equal width is changed depending on the current state of the counter residing in a node where this number is defined as the product of a number of slots in a basic contention window and the current state of the counter. Afterwards, the random numbers of time slots that define the order of media access are selected from the currently available number of slots using the pseudorandom number generator where the probability distribution of sampling the time slots is uniform, and the random time interval defined as the product of the random number of the previously selected time slot reduced by one and the prespecified width of a single time slot is assigned.
Subsequently, after the minimum interpacket space the phase of sequential priority access starts consisting in timing out concurrently the time delay assigned in the priority phase by the use of a clock residing in each node where this delay equals the product of the number of a priority slot assigned to a particular node reduced by one and the prespecified width of a single priority slot, and the state of the communication medium is sensed again, and if the communication medium is still detected to be idle, it is made available to the node with the lowest number of the assigned priority slot. When a given node starts a transmission, by the use of signals generated by the detectors of the communication medium state, the timing out of time delays of priority slots is terminated in the other nodes with higher numbers of the assigned priority slots, and simultaneously the receiving inputs in all the nodes in the network segment are activated.
After completing the priority packet reception, the state of the communication medium is sensed again by all the nodes in the network segment, and if the medium is detected to be idle, the time interval equal to the minimum interpacket space is timed out, and the cycle is repeated for the successive number of a priority slot. Next, if during the prespecified maximum number of the priority time slots, the medium is sensed to be idle by the detectors of a communication medium state, or if the prespecified number of the priority slots equals zero, the random delay assigned previously is timed out, and at the same time the state of the communication medium is sensed again. If the communication medium is still detected to be idle, it is made available to the node with the lowest number of the slot randomly selected.
When the transmission starts, the timing out of the time delays is terminated by the use of the detectors of the communication medium state in the other nodes with higher numbers of slots randomly selected and the receiving inputs in all the nodes are activated at the same time. After completing a given packet transmission, the states of the counters in all the nodes in a given network segment are changed by the increment defining the number of expected packets generated as a result of the reception of a transmitted packet reduced by one, and the state of the communication medium is sensed again by all the nodes. If the medium is detected to be idle, the minimum interpacket space is timed out and simultaneously the number of available time slots is changed in each node depending on the current state of its counter, and the random numbers from the sets of currently available slots are selected, and afterwards, the random delay is assigned, and finally, the assigned random delay is timed out after the minimum interpacket space, and the cycle is repeated.
During the data packet transmission the collisions are detected optionally by the collision detectors, and afterwards, the states of the counters residing in the nodes are increased by one with the use of the corresponding control signals obtained from the collision detectors. If the communication medium is still idle after the time equal to the sum of the minimum interpacket space and the time delay defined by the prespecified number of time slots included in the basic contention window, the state of the counters in all the nodes in a given network segment is decreased by one with the use of the corresponding control signals obtained from the communication medium state detectors.
In the other solution known from the technical literature (K. Jamieson, H. Balakrishnan, Y. Tay, “Sift: A MAC protocol for event-driven wireless sensor networks”, Technical Report, Massachusetts Institute of Technology, LCS-TR-894, 2003) introducing a method of controlling the access to the communication medium of CSMA-type each time before the attempt of packet transmission the state of the communication medium is sensed using the state detectors in each node connected to this medium, and if the medium is detected to be idle, in each packet cycle the prespecified fixed time interval called the minimum interpacket space is timed out by the use of a clock residing in every node, and at the same time the numbers of slots determining the order of the medium access are randomly selected in each node from the prespecified fixed number of time slots of equal width by the use of the pseudorandom generators, while the probability of a random selection of a given slot is geometrically distributed with a characteristic parameter defined as the ratio of the probability of a selection of a given slot to the probability of a selection of the next slot, the value of which is greater than zero and at the same time smaller than or equal to one, and afterwards, the random delay is assigned as the time interval equal to the product of the time slot number selected previously reduced by one and the prespecified width of a single time slot.
Next, after the minimum interpacket space the random delay assigned previously is timed out and the state of the communication medium is at the same time sensed again, whereas, if the medium is detected to be idle, it is made available to the node that has selected the time slot with the lowest number among the numbers randomly selected by all the nodes. When a given node starts to transmit, the timing out of random delays in the other nodes with higher numbers of selected time slots is terminated by the use of the communication medium state detectors, and simultaneously the receiving inputs of the nodes are activated. After completing the reception of the transmitted packet by all the nodes, the state of the communication medium is sensed again, and if the medium is detected to be idle, the minimum interpacket space is timed out and the numbers of the time slots from the prespecified fixed number of available time slots are randomly selected concurrently, and then, the random delay is assigned, and after the minimum interpacket space the random time delay assigned previously is timed out, and the cycle is repeated.